package b.b.g;

import android.view.View;
import android.view.animation.Interpolator;
import b.i.k.t;
import b.i.k.u;
import b.i.k.v;
import java.util.ArrayList;
import java.util.Iterator;

/* compiled from: ViewPropertyAnimatorCompatSet */
public class g {
    public final ArrayList<t> a = new ArrayList();
    public long b = -1;
    public Interpolator c;
    public u d;
    public boolean e;
    public final v f = new a();

    /* compiled from: ViewPropertyAnimatorCompatSet */
    public class a extends v {
        public boolean a = false;
        public int b = 0;

        public void b(View view) {
            int i = this.b + 1;
            this.b = i;
            if (i == g.this.a.size()) {
                u uVar = g.this.d;
                if (uVar != null) {
                    uVar.b(null);
                }
                this.b = 0;
                this.a = false;
                g.this.e = false;
            }
        }

        public void c(View view) {
            if (!this.a) {
                this.a = true;
                u uVar = g.this.d;
                if (uVar != null) {
                    uVar.c(null);
                }
            }
        }
    }

    public void a() {
        if (this.e) {
            Iterator it = this.a.iterator();
            while (it.hasNext()) {
                ((t) it.next()).b();
            }
            this.e = false;
        }
    }

    public void b() {
        if (!this.e) {
            Iterator it = this.a.iterator();
            while (it.hasNext()) {
                t tVar = (t) it.next();
                long j = this.b;
                if (j >= 0) {
                    tVar.c(j);
                }
                Interpolator interpolator = this.c;
                if (interpolator != null) {
                    View view = (View) tVar.a.get();
                    if (view != null) {
                        view.animate().setInterpolator(interpolator);
                    }
                }
                if (this.d != null) {
                    tVar.d(this.f);
                }
                View view2 = (View) tVar.a.get();
                if (view2 != null) {
                    view2.animate().start();
                }
            }
            this.e = true;
        }
    }
}
